@extends('home.parent')
@section('title','修改会员')
@section('head_js')
@endsection
@section('head_css')
<link rel="stylesheet" href="{{ asset('/css/select2/select2.min.css') }}">
<link rel="stylesheet" href="{{ asset('/css/datepicker3.css') }}">
<link rel="stylesheet" href="{{ asset('/css/toggleButtonsMain.css') }}">
@endsection
@section('content')
<div class="content-wrapper">
<section class="content-header">
	<h1>
		修改移动端会员<small></small>
	</h1>
	<ol class="breadcrumb">
		<li><a href="{{URL('admin')}}"><i class="fa fa-dashboard"></i> 首页</a></li>
		<li><a href="{{URL('admin/mobile/index')}}">会员列表</a></li>
		<li class="active">修改移动端会员</li>
	</ol>
</section>
<style>
	form div input[type="password"],form div input[type="text"],select[name="industry_id"],select[name="customertype"],select[name="pay_type"],select[name="pList_id"]{width:280px;color:#717171;}
	form div input[type="password"],form div input[type="text"],select[name="industry_id"],select[name="gender"],select[name="pay_type"],select[name="pList_id"]{width:280px;color:#717171;}
	form div label{padding: 7px 15px 0 0;text-align:right;color:#717171;}
	form div button{margin-right:10px;}
	form div.ca_number{display:none;}
	form div.box-body label{width:100px;}
	form div input.form-control,form div select.form-control{display:inline;}
	form div ul li{list-style-type:none;float:left;padding:5px 0;width:100%;}
	form div ul li>div{width:150px;float:left;border:2px solid transparent;margin-left:10px;border-radius:8px;cursor:pointer;background:#009688;color:#fff;}
	form div ul li>div span{display:block;padding:3px 8px;text-align:center;}
	form div ul li>div span b{color:yellow;}
	form div ul li div span.yes{display:none;padding:0;}
	form div ul li div.active{border:2px solid #f38d24;}
	form div ul li div.active span.yes{display:block;}
	form div ul li>div span label{background:#009688;color:yellow;display:inline-block;text-align:center;padding:0 5px;}
	form div ul li>div span i{cursor:pointer;}
	form div ul li>div span i:hover{color:#f38d24;}
	#data_form span.fa{top:10px;left:390px;margin-left:-18px;position:absolute;cursor:pointer;color:#009688;}
	@media screen and (max-width: 465px) {
		#data_form span.fa{top:41px;left:290px;margin-left:-18px;position:absolute;cursor:pointer;color:#009688;}
	}
</style>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <!--general form elements-->
            <div class="box box-primary">
                <form id="data_form">
                    <div class="box-body">
                        <div class="form-group col-lg-6 col-md-12">
                            <label class="control-label"> 登录用户名</label>
                            <input type="text" name="user_name" class="form-control" value="{{ $data['user_name'] }}" readonly>
                        </div>
                        <div class="form-group col-lg-6 col-md-12">
							<span class="fa fa-eye showPwd"></span>
                            <label class="control-label">登录密码</label>
                            <input type="password" class="form-control" name="pwd" placeholder="不填则默认不修改（6-16位 字母、数字、下划线）" value="" maxlength="16">
                        </div>
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">类型<span style="color: red">*</span></label>
							<select class="form-control" name="type" style="width: 280px">
								<option value="0">--请选择--</option>
								<option value="1" @if($data[ 'type']==1)selected @endif>好友推</option>
								<option value="2" @if($data[ 'type']==2)selected @endif>云快视</option>
							</select>
						</div>

                        <div class="form-group col-lg-6 col-md-12">
                            <label class=" control-label">昵称
                                <span style="color: red">*</span>
                            </label>
                            <input type="text" class="form-control" name="nickname" placeholder="请输入昵称" value="{{ $data['nickname'] }}" maxlength="20">
                        </div>
                        <div class="form-group col-lg-6 col-md-12">
                            <label class=" control-label">性别</label>
                            <select class="form-control" name="gender">
                                <option value="0">--请选择--</option>
                                <option value="1" @if($data[ 'gender']==1)selected @endif>男</option>
                                <option value="2" @if($data[ 'gender']==2)selected @endif>女</option>
                            </select>
                        </div>
                        <div class="form-group col-lg-6 col-md-12">
                            <label class=" control-label">手机号
                                <span style="color: red">*</span>
                            </label>
                            <input type="text" class="form-control" name="mobile" placeholder="请输入联系人手机号" value="{{ $data['mobile'] }}" maxlength="11">
                        </div>
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">账号时长</label>
							<input class="form-control dateTime" name="times" placeholder="账号有效时间" style="width: 280px">
						</div>
						<div class="form-group col-lg-6 col-md-12">
							<label class=" control-label">备注</label>
							<input type="text" class="form-control" name="remark" value="{{ isset($orderlist['remark']) ? $orderlist['remark'] : '' }}" autocomplete="off" placeholder="备注">
						</div>
                    </div>
                    <!--/.box-body-->
                    <div class="box-footer">
						<label class="col-sm-1 control-label"></label>
						<input type="hidden" name="kid" value="{{ $data['id'] }}">
						<button type="button" class="btn btn-info data_form">提 交</button>
						<button type="reset" class="btn btn-default">重 置</button>
						<button type="button" class="btn btn-default" onclick="history.go(-1)">取 消</button>
					</div>
                </form>
            </div>
        </div>
    </div>
</section>
</div>
@endsection
@section('foot_js')
<script src="{{ asset('/js/apk.js') }}"></script>
<script src="{{ asset('/js/tools.js') }}"></script>
<script>
$('select[name="pay_type"]').change(function(){
	if($(this).val()==4){
		$('#data_form div.ca_number').show();
	}else{
		$('#data_form div.ca_number').hide();
	}
});
$('#data_form button.data_form').click(function(){
	var data=$('#data_form').serialize();
	var url = "{{URL('admin/mobile/edit/save')}}";
	var result = puppet.myajax('post',url,data,false);
	if(result.code == 1){
		layer.msg(result.msg,{icon:2});
		return false;
	}else{
		layer.msg(result.msg,{icon:1});
		setInterval(function(){
			window.location.href=result.url;
		},"2000");
	}
})

//时间选择
laydate.render({
	elem: '.dateTime',
	type: 'datetime',
	theme: 'molv',
	range: '~',
	value: ''
});
//查看密码
$('.showPwd').hover(function(){
	$(this).removeClass('fa-eye');
	$(this).addClass('fa-eye-slash');
	$(this).parent().children('input').attr('type','text');
},function(){
	$(this).removeClass('fa-eye-slash');
	$(this).addClass('fa-eye');
	$(this).parent().children('input').attr('type','password');
});
</script>
@endsection